package scala.pattern

import scala.pojo.CasePerson

/**
 * 变量声明中的模式匹配
 */
object MatchVariableTest1 {

  def main(args: Array[String]): Unit = {
    val (x,y) = (2,3)
    println((x,y))

    val Array(first,second,_*) = Array(1,3,45,5,11)
    println((first,second))

    val CasePerson(name, age) = CasePerson("zhangsan", 16)
    println((name, age))
  }
}
